package cn.hfatec.shms.system.keyGenerator.dao;

import cn.hfatec.mybatis.mapper.SqlMapper;
import cn.hfatec.shms.system.keyGenerator.model.KeyGenerator;
import cn.hfatec.shms.system.keyGenerator.model.KeyGeneratorParams;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 *
 * @author hfatec
 * @version 1.0
 *
 * the JAVA code is generate by middlegen
 *
 */
@Component("KeyGeneratorDao")
public interface KeyGeneratorDao extends SqlMapper {

    /**
     *
     * 查询数据
     *
    */
    public List queryKeyGenerator(@Param("params") KeyGeneratorParams params);

    /**
     *
     * 根据主键获取数据
     *
     */
    public KeyGenerator getKeyGeneratorById(Integer id);

    /**
     *
     * 插入数据
     *
     */
    public void insert(KeyGenerator keyGenerator);

    /**
     *
     * 删除数据
     *
     */
    public void delete(Integer id);

    /**
     *
     * 更新数据
     *
     */
    public void update(KeyGenerator keyGenerator);

    /**
     *
     * 更新自增主键
     *
     * @param keyGenerator
     */
    public void updateNum(KeyGenerator keyGenerator);

    /**
     *
     * 更新数据
     *
     */
    public void updateByType(@Param("type")String type,@Param("num")Integer num);

    /**
     *
     * 根据类型获取自增主键
     *
     * @param type
     * @return
     */
    public String getKeyGeneratorByType(String type);
}
